graph theory:adjacency matrix